/*
 ============================================================================
 Page	     : 148
 Name        : boolean.c
 Date	     : 20210403
 Author      : Hbue 18060333
 Copyright   : Your copyright notice
 Description : 使用_Bool类型的变量variable
 ============================================================================
 */

#include <stdio.h>

int main(void)
{
	long num = 0;
	long sum = 0;
	_Bool input_is_good;

	printf("Please enter an integer to be summed ");
	printf("(q to quit): ");
	input_is_good = (scanf("%ld",&num) == 1);
	while(input_is_good)
	{
		sum = sum + num;
		printf("Please enter next integer (q to quit): ");
		input_is_good = (scanf("%ld", &num) == 1);
	}
	printf("Those integers sum to %ld.\n", sum);
	
	return 0;
}

